package com.more.offer.designpatterns.shareunit;

import java.awt.*;

/**
 * @author pinoc
 * @date 2021/10/25
 * @description
 */
public class TreeType {

	private Color color;

	private String name;

	private String otherTreeData;

	public TreeType(Color color, String name, String otherTreeData) {
		this.color = color;
		this.name = name;
		this.otherTreeData = otherTreeData;
	}

	public void draw(Graphics g, int x, int y) {
		//绘制矩形
		g.setColor(Color.black);
		g.fillRect(x - 1, y, 10, 15);
		//绘制椭圆
		g.setColor(color);
		g.fillOval(x - 5, y - 10, 10, 20);
	}
}
